package utils

import (
	"fmt"
	"os/exec"
)

///获取设备是否在线
func GetDeviceIsOnline(deviceIp string) bool {
	fmt.Println(deviceIp)
	shell := fmt.Sprintf("ping -c 3 -i0.2 -W 3 %s &>/dev/null", deviceIp)
	cmd := exec.Command("/bin/sh", "-c", shell)
	_, err := cmd.Output()
	if err != nil {
		return false
	}
	return true
}
